package com.wfy.orchestra.thread

import kotlinx.coroutines.CoroutineScope
import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.launch

/**
 * @author : wangfengyuan
 * e-mail  : 446950883@qq.com
 * time    : 2025/3/20
 * desc    : 协程实现（供 Kotlin 协程架构使用）
 * version : 1.0
 */
class CoroutineTaskExecutor(
    private val scope: CoroutineScope
) : ITaskExecutor {
    override fun execute(task: Runnable) {
        scope.launch(Dispatchers.Default) { task.run() }
    }

    override fun shutdown() { /* 取消协程作用域 */
    }
}